package com.atguigu.tingshu.order.enumeration;

import com.atguigu.tingshu.common.constant.SystemConstant;

public enum PayWayEnum {

    ORDER_PAY_WAY_WEIXIN(SystemConstant.ORDER_PAY_WAY_WEIXIN , "微信支付") ,
    ORDER_PAY_WAY_ALIPAY(SystemConstant.ORDER_PAY_WAY_ALIPAY , "支付宝支付") ,
    ORDER_PAY_ACCOUNT(SystemConstant.ORDER_PAY_ACCOUNT , "余额支付") ;

    private String payWay ;
    private String payWayName ;

    private PayWayEnum(String payWay , String payWayName) {
        this.payWay = payWay ;
        this.payWayName = payWayName ;
    }

    public static String getPayWayName(String payWay) {
        PayWayEnum[] payWayEnums = PayWayEnum.values();
        for (PayWayEnum payWayEnum : payWayEnums) {
            String pay = payWayEnum.payWay;
            if(pay.equals(payWay)) {
                return payWayEnum.payWayName;
            }
        }
        return null ;
    }

}